<?php $this->layout = "//layouts/column1"; ?>
<h1>Deposit</h1>
<div style="background: #f9f9f9;padding: 3px 10px;border: 3px solid #eee;">
    <?php if (Yii::app()->user->hasFlash('diposit')): ?>

        <div class="flash-success">
            <?php echo Yii::app()->user->getFlash('diposit'); ?>
        </div>

    <?php else: ?>

        <p class="notice">
            Prior to submitting your request, we kindly request you to carefully review your inputs several times.        
        </p>

        <div class="form">
            <?php
            switch ($model->method) {
                case 'LR':
                    //echo "Liberty Reserve";
                    $this->renderPartial('_diposit_lr', array('model' => $model));
                    break;
                case 'EP':
                    //echo "Ego Pay";
                    $this->renderPartial('_diposit_ep', array('model' => $model));
                    break;
                case 'PM':
                    //echo "Perfect Money";
                    $this->renderPartial('_diposit_pm', array('model' => $model));
                    break;
                default:
                    $form = $this->beginWidget('CActiveForm', array(
                        'id' => 'deposit-form',
                        'enableClientValidation' => true,
                        'clientOptions' => array(
                            'validateOnSubmit' => true,
                        ),
                            ));
                    ?>

                    <?php echo $form->errorSummary($model); ?>
            
                    <div class="row">
                        <?php echo $form->labelEx($model, 'package'); ?>
                        <?php
                        $list = CHtml::listData(Package::model()->findAll(), 'package_id', 'name');
                        echo $form->dropDownList($model, 'package', $list);
                        ?>
                        <?php echo $form->error($model, 'package'); ?>
                    </div>

                    <div class="row">
                        <?php echo $form->labelEx($model, 'method'); ?>
                        <?php
                        $sql = "select * from payment_processor where status = '1'";
                        $_lh = Yii::app()->db->createCommand($sql)->queryAll(); 
                        $list = CHtml::listData($_lh, 'code', 'name');
                        echo $form->dropDownList($model, 'method', $list);
                        ?>
                        <?php echo $form->error($model, 'method'); ?>
                    </div>

                    <p class="note"><span class="required">*</span> (Asterisk) denotes required fields which therefore must not be left empty.</p>
                    <div class="row buttons">
            <?php echo CHtml::submitButton('Next'); ?>
                    </div>

                    <?php $this->endWidget();
            }
            ?>
        </div>
<?php endif; ?>
</div>